The Internal Structure of Python Eggs
STOP! This is not the first document you should read!
IMO:egg-infoって全然作られるけれど、deprecateなの?
Eggs and their Formats
two basic formats
.egg format
.egg-info format
a file or directory placed adjacent to the project’s code and resources, that directly contains the project’s metadata.
Code and Resources
For the .egg-info format, however, the base location is the directory that contains the .egg-info, and thus it is the directory that must be added to sys.path to make the egg importable.
IMO:src-layoutでpip install -eするとsrcの下にegg-infoができるし、flat-layoutだとルートにegg-infoができる
Project Metadata
For the .egg-info format, metadata is stored directly within the .egg-info directory itself.
Filename-Embedded Metadata
Egg Links
Standard Metadata
In addition to the minimum required PKG-INFO metadata, projects can include a variety of standard metadata files or directories, as described below.
.txt File Formats
Dependency Metadata
requires.txt
setup_requires.txt
dependency_links.txt
A list of dependency URLs, one per line, as specified using the dependency_links keyword to setup().
depends.txt – Obsolete, do not create!
namespace_packages.txt – Namespace Package Metadata
entry_points.txt – “Entry Point”/Plugin Metadata
This is a “sectioned” text file, whose contents encode the entry_points keyword supplied to setup().
The scripts Subdirectory
Zip Support Metadata
top_level.txt – Conflict Management Metadata
This file is a list of the top-level module or package names provided by the project, one Python identifier per line.
Subpackages are not included
This data is used by pkg_resources at runtime to issue a warning if an egg is added to sys.path when its contained packages may have already been imported.
SOURCES.txt – Source Files Manifest
This file is roughly equivalent to the distutils’ MANIFEST file.
The file is automatically generated by setuptools whenever the egg_info or sdist commands are run, and it is not user-editable.
Although this metadata is included with distributed eggs, it is not actually used at runtime for any purpose.
Its function is to ensure that setuptools-built source distributions can correctly discover what files are part of the project’s source,
「SOURCES.txtの機能は、setuptoolsがビルドするソース配布物(sdist)がプロジェクトのソースの一部となるファイル群を正しく発見するのを保証すること」
In other words, SOURCES.txt has little or no runtime value for being included in distributed eggs,
Other Technical Considerations
積ん読